home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / Newton Sample Code 1.1 / Proto Templates / DateExpando-1 / Date Expando.p.text < prev    next >
Encoding:
Text File  |  1994-03-07  |  2.2 KB  |  99 lines  |  [TEXT/MPS ]

  1.  
  2. // ---- End Project Data ----
  3.  
  4.  
  5. // ---- File Date Expando.t ----
  6.  
  7. // Before Script for "myBase"
  8. // Copyright 1993-1994 Apple Computer, Inc. All rights reserved.
  9.  
  10. myBase :=
  11.    {viewFlags: 1,
  12.     viewFormat: nil,
  13.     viewBounds: {left: 0, top: 0, right: 240, bottom: 296},
  14.     declareSelf: 'base,
  15.     viewSetupFormScript:
  16.       func()
  17.       begin
  18.       local b := GetAppParams();
  19.       constant kMaxWidth := 240;
  20.       constant kMaxHeight := 336;
  21.       
  22.       viewBounds := RelBounds(b.appAreaLeft, b.appAreaTop,
  23.               Min(b.appAreaWidth, kMaxWidth),
  24.               Min(b.appAreaHeight, kMaxHeight) );
  25.       
  26.       end,
  27.     viewclass: 74,
  28.     debug: "myBase"
  29.    };
  30.  
  31. _view000 := /* child of myBase */ {_proto: protoLargeClosebox};
  32.  
  33.  
  34.  
  35. myExpando := /* child of myBase */
  36.    {
  37.     viewSetupFormScript:
  38.       func()
  39.       begin
  40.           self.target := self;
  41.           self.lines := Clone(baseLines) ;
  42.           self.dateData := Time();
  43.           self.dateData2 := Time();
  44.           :AddItem({_proto: protoDateExpando, label: "Last Earth Contact", path: 'dateData});
  45.           :AddItem({_proto: protoDateExpando, label: "Gallifrey  Time", path: 'dateData2});
  46.           inherited:?viewSetupFormScript() ;
  47.       end,
  48.     flushEdits:
  49.       func()
  50.       begin
  51.           nil
  52.       end,
  53.     lines: nil,
  54.     numlines: 2,
  55.     editWidth: 200,
  56.     editHeight: 50,
  57.     deleteThis: "delete",
  58.     viewBounds: {left: 8, top: 24, right: 232, bottom: 144},
  59.     baseLines:
  60.       [{_proto: protoTextExpando,
  61.           label: "Override",
  62.           path: 'deleteThis,
  63.           entryFlags: (1 << 0)  + (65535 << 9)},
  64.           {_proto: protoTextExpando,
  65.           label: "These",
  66.           path: 'deleteThis,
  67.           entryFlags: (1 << 0)  + (65535 << 9)}],
  68.     AddItem:
  69.       func(theItemProto)
  70.       begin
  71.           AddArraySlot(lines, Clone(theItemProto));
  72.           numLines := numLines + 1;
  73.       
  74.           // if the view is displayed, then update the children
  75.           if GetView(self) then
  76.               :RedoChildren();
  77.       end,
  78.     dateData: nil,
  79.     firstLine: 2,
  80.     closeEdit:
  81.       func(closedView)
  82.       begin
  83.           nil
  84.       end,
  85.     dateData2: nil,
  86.     _proto: protoExpandoShell,
  87.     debug: "myExpando"
  88.    };
  89. // View myExpando is declared to myBase
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97. // ---- Beginning of section for non used Layout files ----
  98.  
  99. // End of output